//
//  ViewController.m
//  28---UIViewAnimation
//
//  Created by 冀永金 on 16/8/22.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ViewController.h"
#import "UIView+Frame.h"
@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *myImageView;
@property (weak, nonatomic) IBOutlet UIImageView *userImage;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *centerY;
@property (weak, nonatomic) IBOutlet UIImageView *passWordImage;
@property (weak, nonatomic) IBOutlet UITextField *userTextField;
@property (weak, nonatomic) IBOutlet UITextField *passWordTextField;
@property (weak, nonatomic) IBOutlet UIButton *loginButton;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buttonWith;
@property (weak, nonatomic) IBOutlet UIView *orView;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buttonPassWord;
@property (weak, nonatomic) IBOutlet UIButton *button;
@property (weak, nonatomic) IBOutlet UIView *orLeftView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _myImageView.transform = CGAffineTransformMakeTranslation(0, -300);
    _button.transform = CGAffineTransformMakeTranslation(self.view.center.x, 0);
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    self.buttonWith.constant = self.view.bounds.size.width / 2;
    [UIView animateWithDuration:2 animations:^{
        [self.view layoutIfNeeded];
    }];
    [UIView animateWithDuration:2 animations:^{
        _button.transform = CGAffineTransformIdentity;
    }];
    [UIView animateWithDuration:2 animations:^{
        _myImageView.transform = CGAffineTransformIdentity;
    }];
    [UIView animateWithDuration:2 animations:^{
        _userImage.yj_width = 40;
    }];
    [UIView animateWithDuration:2 animations:^{
        _passWordImage.yj_width = 40;
    }];
    [UIView animateWithDuration:2 animations:^{
        _userTextField.yj_width = -200;
    }];
    [UIView animateWithDuration:2 animations:^{
        _passWordTextField.yj_width = -200;
    }];
    [UIView animateWithDuration:2 animations:^{
        _orView.yj_width = 110;
    }];
    [UIView animateWithDuration:2 animations:^{
        _orLeftView.yj_width = -110;
    }];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
